<extend name="Base/list" />

<block name="title">产品管理</block>

<block name="nav">
<li class="current"><a href="{:U(CONTROLLER_NAME.'/index')}">列表</a></li>
<li><a href="{:U(CONTROLLER_NAME.'/add')}">添加</a></li>
</block>

<block name="search">
<form method="get" action="" id="search"><input type="hidden" name="c" value="{$Think.const.CONTROLLER_NAME}"><input type="hidden" name="a" value="{$Think.const.ACTION_NAME}">搜索：<select name="sid" class="select"><option value="0">查看所有分类</option>{$Sort}</select> <input type="text" name="keyword" value="{$keyword}" class="input-text"><input type="submit" value="搜索" class="btn btn-primary radius"></form>
</block>

<block name="tip">
<table id="tip">
  <tr><th colspan="2">技巧提示</th></tr>
  <tr><td class="num">1、</td><td>此模块下的“是否默认”设置仅在后台添加订单时有效，前台订单页面中的默认产品请在<a href="javascript:;" onclick="addTab('{:U('Template/index')}','模板管理')">模板管理</a>模块中进行设置。</td></tr>
</table>
</block>

<block name="list">
<if condition="$All">
{$page}
<div id="list">
  <form method="post" action="{:U(CONTROLLER_NAME.'/sort')}">
    <table>
      <tr><th class="name">产品名称</th><th class="psort">产品分类</th><th class="price">产品价格</th><th class="sort"><input type="submit" value="排序" class="btn btn-primary radius"></th><th class="view">前台显示</th><th class="selected">是否默认</th><th class="date">添加时间</th><th class="control">操作</th></tr>
      <foreach name="All" key="key" item="value">
      <tr><td style="color:{$value['color']};">{$value['name']|keyword=$keyword}</td><td>{$value['psort']}</td><td>{$value['price']|keyword=$keyword}元</td><td><input type="text" name="sort[{$value['id']}]" value="{$value['sort']}" class="input-text"></td><td><if condition="$value['view']==0"><span class="green">否</span> | <a href="{:U(CONTROLLER_NAME.'/view',array('id'=>$value['id']))}">前台显示</a><elseif condition="$value['view']==1"/><span class="red">是</span> | <a href="{:U(CONTROLLER_NAME.'/view',array('id'=>$value['id']))}">取消显示</a></if></td><td><if condition="$value['selected']"><span class="red">是</span><else/><a href="{:U(CONTROLLER_NAME.'/selected',array('id'=>$value['id']))}">设为默认</a></if></td><td>{$value['date']|dateFormat}</td><td><a href="{:U(CONTROLLER_NAME.'/update',array('id'=>$value['id']))}">修改</a>/<a href="{:U(CONTROLLER_NAME.'/delete',array('id'=>$value['id']))}">删除</a></td></tr>
       </foreach>
    </table>
  </form>
</div>
{$page}
<else/>
<p id="nothing">没有找到您搜索的产品</p>
</if>
</block>